﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace RRKAutohaus.Core.Repositories
{
    public interface IRepository<T> where T: class
    {
        #region CRUD methods
        void AddEntity(T entity);
        IQueryable<T> GetAll();
        IQueryable<T> FindEntity(Expression<Func<T, bool>> predicate);

        T FindEntity(int id);
        void UpdateEntity(T entity);
        void DeleteEntity(int id);
        #endregion

        #region common methods
        int GetCount(Expression<Func<T, bool>> predicate);
        #endregion


    }
}
